<extend name='Layout/page'/>
<block name="content">
	<div class="popup-box">
		{:widget('PageHeader',array('name'=>'写消息','search'=>'N'))}
		<div class="frame">
			<form  method='post' id="form_data" name="form_data" enctype="multipart/form-data">
				<input type="hidden" id="ajax" name="ajax" value="0">
				<input type="hidden" id="to" name="to"/>
				<input type="hidden" id="opmode" name="opmode" value="add"/>
				<input type="text" style="display:none">

				<div class="box">
					<label class="input-label" for="recever">收信人*：</label>
					
						<div id="actor_wrap" class="input-box">
							<a class="pull-right btn btn-link text-center" id="btn_popup_contact"> <i class="fa fa-user"></i> </a>
							<div class="wrap" >
								<span class="address_list"></span>
								<span class="text" >
									<input class="letter" type="text"  >
								</span>
							</div>
							<div class="search dropdown ">
								<ul class="dropdown-menu"></ul>
							</div>
						</div>
					</div>
				</div>
				<div class="box">
					<label class="input-label" for="recever">内容*：</label>
					
						<textarea  class="editor" id="content" name="content" style="width:100%;height:300px;" check="required" info="请输入内容"></textarea>
					</div>
				</div>
				<div class="box">
					<label class="input-label" for="name">附件：</label>
					
						{:widget('file_upload/add')}
					</div>
				</div>
				<div class="box">
					
						<a id="btn_save"  class="btn">发送</a>
						<a onclick="go_return_url();" class="btn btn-return">取消</a>
					</div>
				</div>
			</form>
		</div>
	</div>
</block>

<block name="js">
	<script type="text/javascript">
		layui.use([ 'global','test','moxie','plupload'], function() {
			
			var $ = layui.jquery;
			
			
			
			$('#btn_popup_contact').on('click',function(){
				
			});
			
			$('#btn_save').on('click', function() {
				$("#to").val("");
				$("#recever .address_list span").each(function() {
					$("#to").val($("#to").val() + $(this).find("b").text() + '|' + $(this).attr("data") + ";");
				});
				if ($("#to").val() == "") {
					ui_error("请选择收信人");
					$("#recever .letter").focus();
					return false;
				}
				send_form("form_data", "{:url('save')}");
			});

		});

	</script>

</block>